#ifndef SWP_ACTIVITY_GRAPHIC_ITEM_CONTENT_H
#define SWP_ACTIVITY_GRAPHIC_ITEM_CONTENT_H

#include <igraphicitemcontent.h>

#include <QtGui/QGraphicsSimpleTextItem>

namespace swp
{

class SwpActivityGraphicItemContent : public QGraphicsSimpleTextItem,
    public core::IGraphicItemContent
{
public:
    SwpActivityGraphicItemContent(const QString& activityName,
        QGraphicsItem* parent = 0);
    ~SwpActivityGraphicItemContent();

    void setActivityName(const QString& activityName);
    QString activityName() const;

    // IGraphicItemContent
    QGraphicsItem* graphicsItem() const;
    void drawThumbnail(QPainter& painter, const QRectF& boundingRect);
    QRectF croppedBoundingRect() const;
    void recheckIfFits();
    void setPalette(const core::Palette* const palette);

    // ISerializable
    bool doActionForProperty(const QString& property,
        const QVariantList& value, const core::SerializationEngine& helper);
    void deserializationFinished(bool ok);
    QHash<QString, QVariantList> serializationData(
        const core::SerializationEngine& helper) const;

    QRectF boundingRect() const;

private:
    QString m_name;
    bool m_cropped;
};

} // namespace swp

#endif
